<?php
	if (isset($_GET['flag'])){
		$flag = $_GET['flag'];
	}else{
		$flag = -1;
	}
?>

<link rel="stylesheet" type="text/css" href="../css/ui/jquery.ui.all.css" />
<link rel="stylesheet" href="../css/ui/jquery.ui.datepicker.css" type="text/css" />
<link rel="stylesheet" href="../css/content.css" type="text/css" />

<script type="text/javascript">

	Ext.onReady(function(){
        $( "#datepicker" ).datepicker({
			showOn: "button",
			buttonImage: "../images/calendar.gif",
			buttonImageOnly: true,
			dateFormat: 'yy/mm/dd'
		});
var list_location = function(status){
	var list ="<label for='location'>Location</label>";
	list +="<select name='location' id='location' style='margin-top: 5px;'>";
	switch(status){
		case 0:
			list += "<option value='0' selected='selected'>LEFT</option>";
		
		break;
		case 1:
			list += "<option value='1' selected='selected'>RIGHT</option>";
		break;
		case 2:
			list += "<option value='0' selected='selected'>LEFT</option>";
			list += "<option value='1'>RIGHT</option>";
		break;
	}
	$('#list_location').html(list);
}
	list_location(2);
	$("#listpage").bind('change',function(){
		var value = ($('#group').attr('value'));
		switch(value){
			case 'home':
				list_location(1);
			break;
			case 'menu':
				list_location(0);
			break;	
			case 'promotion':
				list_location(2);
			break;	
			case 'contact':
				list_location(1);
			break;
			case 'banner':
				list_location(0);
			break;
			case 'header':
				list_location(0);
			break;
					
		}
	});
	var flag = <?php echo $flag?>;
	if(flag == 0){
		alert("Vui lòng nhập đúng định dạng('jpg', 'jpeg', 'gif', 'png', 'bmp')");
	}
	if(flag == 1){
		alert("Đã thêm thành công");
	}
});
</script>
	<div id="wrapper">
		<form id="form" method="POST" action="services/upload.php" enctype="multipart/form-data">
			<fieldset>
				<legend>Form Logo Images</legend>				
					<div id="listpage">
						<label for="group">Group</label>
						<select name="group" id="group" style="height: 20px; margin-top: 5px;">
							<option value="home">HOME</option>
							<option value="menu" >MENU</option>
							<option value="promotion" selected="sellected" >PROMOTION</option>
							<option value="contact">CONTACT</option>
							<option value="banner">BANNER</option>
							<option value="header">HEADER</option>
						</select>
					</div>
                    <div>
                        <label for="date">Date</label>
                        <input id="datepicker"  name="date" type="text" value="<?php echo date("Y/m/d"); ?>" readonly="true" />
                    </div>
                    <div id='list_location'>
                    	
                    </div>					
					<div id="message">
						<label for="upload">Logo</label>
						<input type="file" id="uploadlogo" name="uploadlogo" style="margin-top: 5px;" />
					</div>
					
					<div>
						<input type="submit" name="submit" value="Add Logo" id="add_logo" class="button"  />

			</fieldset>
		</form>
	</div><!--end wrapper-->